package umich.infinity.facebookconn;

/**
 * #############################################################################
 * #
 * 
 * DOCOMO Innovations, Inc.
 * 
 * Copyright © 2011 DOCOMO Innovations, Inc. All rights reserved.
 * 
 * 
 * 
 * Date of Preparation: 08/01/2011
 * 
 * Contact: kozat@docomoinnovations.com
 * 
 * 
 * 
 * All intellectual property rights related to this software are vested in
 * DOCOMO Innovations.
 * 
 * DOCOMO Innovations is under no obligation to maintain or support the
 * software.
 * 
 * Neither DOCOMO Innovations nor its employees are responsible for any damage
 * or loss resulting from the use of the software.
 * 
 * #############################################################################
 * #
 */

import java.util.HashMap;
import java.util.Map;
import java.util.Set;

public class Bundle {
	Map mMap;
	
	public Bundle ()  {
		mMap = new HashMap();
	}
	
	public boolean containsKey(String key) {
		return mMap.containsKey(key);
	}
	
	public void putString(String key, String value) {
		mMap.put(key, value);
	}

	public Set<String> keySet() {
		return (Set<String>) mMap.keySet();
	}
	
	public byte[] getByteArray(String key) {
		if (mMap.get(key)!=null && mMap.get(key) instanceof byte[]) {
			return (byte[]) mMap.get(key);
		} else {
			return null;
		}
	}
	
	public String getString(String key) {
		if (mMap.get(key)!=null && mMap.get(key) instanceof String) {
			return (String) mMap.get(key);
		} else {
			return null;
		}		
	}
	
	public void putAll(Bundle b) {
		mMap.putAll(b.mMap);
	}
	
	public void putByteArray(String key, byte[] byteArray) {
		mMap.put(key, byteArray);
	}
	
	public boolean isEmpty() {
		return mMap.isEmpty();
	}
}
